package com.yifeng.repo.micro.service.server.mps;

import feign.Param;
import feign.RequestLine;
import next.fire.mps.api.CardTemplateService;
import org.springframework.cloud.openfeign.FeignClient;

import java.util.List;

@FeignClient(name = "mpsCardTemplateServiceClient", url = "${yfcloud.micro.service.mps.url}", path = "/fire-mps")
public interface CardTemplateServiceClient extends CardTemplateService {

    @Override
    @RequestLine("POST /CardTemplateService/uploadImage")
    String uploadImage(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("type") String type,
                       @Param("name") String name, @Param("body") String body);

    @Override
    @RequestLine("POST /CardTemplateService/save")
    String save(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("jsonPropertyParams") String jsonPropertyParams);

    @Override
    @RequestLine("POST /CardTemplateService/update")
    void update(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("newJsonPropertyParams") String newJsonPropertyParams);

    @Override
    @RequestLine("POST /CardTemplateService/getByCardTemplateId")
    String getByCardTemplateId(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("cardTemplateId") String cardTemplateId);

    @Override
    @RequestLine("POST /CardTemplateService/setFormField")
    void setFormField(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("cardTemplateId") String cardTemplateId,
                      @Param("requiredFields") List<String> requiredFields, @Param("optionalFields") List<String> optionalFields);
}
